package com.tingyuge.base.thread.concurrent2;

/**
 * Created by xiaodao
 * date: 2019/11/26
 */
public class MyTest2 {
}

class MyClass{
    public synchronized void hello(){
        try {
            Thread.sleep(4000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        System.out.println("hello");

    }
    public synchronized void word(){
        try {
            Thread.sleep(4000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        System.out.println("word");

    }
}